//Replication Submission //

//Load Effect of Campaign Contributions on Legislator Behavior Intra Dairy Industry Interest Group Competition//

//Table 1A Summary of Statistics for State and District Level Spending Data (N=301)

//Summary Stats copied into excel///

summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1996
summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1999

// Table 1B Summary Statistic District Level Spending Data: Switchers and Non Switchers///
//Summary Stats copied into excel///
///Switchers Summary Stats///
summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1996 & Delta==0
summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1999 & Delta==0

///Non Switchers Summary Stats///
summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1996 & Delta==1
summarize Vote  Farmers Processors ACU_Adjusted term log_milk  if Year==1999 & Delta==1


///Difference in Means p-Value///
//P-Values copied into excel///
ttest Farmers if Year==1996, by (Delta)
ttest Farmers if Year==1999, by (Delta)
ttest Processors if Year==1996, by (Delta)
ttest Processors if Year==1999, by (Delta)
ttest term if Year==1996, by (Delta)
ttest ACU_Adjusted if Year==1996, by (Delta)
ttest ACU_Adjusted if Year==1999, by (Delta)
ttest log_milk if Year==1996, by (Delta)
ttest log_milk if Year==1999, by (Delta)

//Table 2 // 
//Summary Stats copied into excel///

su Vote if Vote ==1 & Year ==1996 & Delta ==0 
su Vote if Vote ==1 & Year == 1996 & Delta ==1
su Vote if Vote ==0 & Year ==1996 & Delta ==0 
su Vote if Vote ==0 & Year == 1996 & Delta ==1



//Table 3//
sort main_id

clogit Vote Farmers Processors ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table3_1.doc, replace label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote farmers_processors ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table3_1.doc, append label eform
clogit Vote Farmers Processors  if Junior ==1,or group(FEC_Code) cluster(FEC_Code)
outreg2 using Table3_1.doc, append label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors if if Junior ==1, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote farmers_processors  if Junior ==1,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table3_1.doc, append label eform


///Table 4////
clogit Vote Farmers Processors ACU_Adjusted term  log_milk ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using Table4_1.doc, replace label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote farmers_processors ACU_Adjusted term log_milk  ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using Table4_1.doc, append label eform
clogit Vote Farmers Processors ACU_Adjusted term log_milk   if Junior ==1, or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table4_1.doc, append label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors if Junior ==1, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote farmers_processors ACU_Adjusted term log_milk   if Junior ==1, or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table4_1.doc, append label eform


//Table 5 //
clogit Vote Farmers Processors  ACU_Adjusted term  log_milk if CA ==0 ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table5_1.doc, replace label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors  ACU_Adjusted term  log_milk if CA ==0 , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote Farmers Processors   ACU_Adjusted term  log_milk if AgricultureCommittee ==0 ,or  group(FEC_Code) cluster(FEC_Code) 
outreg2 using Table5_1.doc, append label eform
randcmd ((Farmers Processors) clogit Vote Farmers Processors   ACU_Adjusted term  log_milk if AgricultureCommittee ==0  , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Processors)
clogit Vote Farmers_95_98 Processors_95_98  ACU_Adjusted term  log_milk ,or  group(FEC_Code) cluster(FEC_Code) 
outreg2 using Table5_1.doc, append label eform
randcmd ((Farmers_95_98 Processors_95_98) clogit Vote Farmers_95_98 Processors_95_98  ACU_Adjusted term  log_milk, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers_95_98 Processors_95_98)
clogit Vote Farmers_PreVote_Cycle Processors_PreVote_Cycle  ACU_Adjusted term  log_milk ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table5_1.doc, append label eform
randcmd ((Farmers_PreVote_Cycle Processors_PreVote_Cycle) clogit Vote Farmers_PreVote_Cycle Processors_PreVote_Cycle  ACU_Adjusted term  log_milk, or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers_PreVote_Cycle Processors_PreVote_Cycle)


//Table 6 //

clogit Vote Farmers narrow_Processors ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, replace label eform
randcmd ((Farmers narrow_Processors) clogit Vote Farmers narrow_Processors , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers narrow_Processors)
clogit Vote Farmers Grocery ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, append label eform
randcmd ((Farmers Grocery) clogit Vote Farmers Grocery , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers Grocery)
clogit Vote Farmers narrow_Processors Grocery ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, append label eform
randcmd ((Farmers narrow_Processors Grocery) clogit Vote Farmers narrow_Processors Grocery , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers narrow_Processors Grocery)
clogit Vote Farmers narrow_Processors ACU_Adjusted term  log_milk ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, append label eform
randcmd ((Farmers narrow_Processors) clogit Vote Farmers narrow_Processors ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers narrow_Processors)
clogit Vote Farmers Grocery ACU_Adjusted term  log_milk ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, append label eform
randcmd ((Farmers Grocery) clogit Vote Farmers Grocery ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers narrow_Processors)
clogit Vote Farmers narrow_Processors Grocery ACU_Adjusted term  log_milk ,or  group(FEC_Code) cluster(FEC_Code)
outreg2 using Table6_1.doc, append label eform
randcmd ((Farmers narrow_Processors Grocery) clogit Vote Farmers narrow_Processors Grocery ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(Farmers narrow_Processors Grocery)

//Figure 1, 2///

ssc install marhis

set matsize 800

logit Vote Farmers Processors term log_milk ACU_Adjusted     g1	g2	g3	g4	g5	g6	g7	g8	g9	g10	g11	g12	g13	g14	g15	g16	g17	g18	g19	g20	g21	g22	g23	g24	g25	g26	g27	g28	g29	g30	g31	g32	g33	g34	g35	g36	g37	g38	g39	g40	g41	g42	g43	g44	g45	g46	g47	g48	g49	g50	g51	g52	g53	g54	g55	g56	g57	g58	g59	g60	g61	g62	g63	g64	g65	g66	g67	g68	g69	g70	g71	g72	g73	g74	g75	g76	g77	g78	g79	g80	g81	g82	g83	g84	g85	g86	g87	g88	g89	g90	g91	g92	g93	g94	g95	g96	g97	g98	g99	g100	g101	g102	g103	g104	g105	g106	g107	g108	g109	g110	g111	g112	g113	g114	g115	g116	g117	g118	g119	g120	g121	g122	g123	g124	g125	g126	g127	g128	g129	g130	g131	g132	g133	g134	g135	g136	g137	g138	g139	g140	g141	g142	g143	g144	g145	g146	g147	g148	g149	g150	g151	g152	g153	g154	g155	g156	g157	g158	g159	g160	g161	g162	g163	g164	g165	g166	g167	g168	g169	g170	g171	g172	g173	g174	g175	g176	g177	g178	g179	g180	g181	g182	g183	g184	g185	g186	g187	g188	g189	g190	g191	g192	g193	g194	g195	g196	g197	g198	g199	g200	g201	g202	g203	g204	g205	g206	g207	g208	g209	g210	g211	g212	g213	g214	g215	g216	g217	g218	g219	g220	g221	g222	g223	g224	g225	g226	g227	g228	g229	g230	g231	g232	g233	g234	g235	g236	g237	g238	g239	g240	g241	g242	g243	g244	g245	g246	g247	g248	g249	g250	g251	g252	g253	g254	g255	g256	g257	g258	g259	g260	g261	g262	g263	g264	g265	g266	g267	g268	g269	g270	g271	g272	g273	g274	g275	g276	g277	g278	g279	g280	g281	g282	g283	g284	g285	g286	g287	g288	g289	g290	g291	g292	g293	g294	g295	g296	g297	g298	g299	g300	g301,  cluster(FEC_Code)


//Figure 1//
marhis Farmers, points(50) percent

//Figure 2//
marhis Processors, points(50) percent


//Figure 3,4,5 /// 
/// //Load Effect of Campaign Contributions on Legislator Behavior Intra Dairy Industry Interest Group Competition 2 //////

logit Vote_1 Famers_Delta Processor_Delta if Year==1996 & Delta==0,nocon robust

marhis Famers_Delta , points(50) percent

marhis Processor_Delta , points(50) percent

//Figure 6A///

twoway (scatter Famers_Delta Number if Delta==0 & Vote==0, sort) (scatter Famers_Delta Number  if Delta==1 & Vote==0, sort) 

//Figure 6B ///

twoway (scatter Famers_Delta Number if Delta==0 & Vote==1, sort) 


//Figure 7A ///


twoway (histogram Farmers if Delta==0, start(-.999) width(1) frac lcolor(gs12) fcolor(gs10)) (histogram Farmers_1999 if Delta==0,start(-.999) width(1)frac fcolor(none) lcolor(red))

//Figure 7B///

twoway (histogram Processors if Delta==0, start(-.999) width(1) frac lcolor(gs12) fcolor(gs10)) (histogram Processors_Grocers_1999 if Delta==0,start(-.999) width(1)frac fcolor(none) lcolor(red))


/// //Load Effect of Campaign Contributions on Legislator Behavior Intra Dairy Industry Interest Group Competition  //////


///Appendix A1A///

summarize Farmers if Year == 1996 & Farmers >0 &Processors >0 & Delta==0 
summarize Farmers if Year == 1996 & Farmers >0 &Processors <=0 & Delta==0 
summarize Farmers if Year == 1996 & Farmers <=0 &Processors >0 & Delta==0 
summarize Farmers if Year == 1996 & Farmers <=0 &Processors <=0 & Delta==0 

///Appendix A1B///

summarize Farmers if Year == 1999 & Farmers >0 &Processors >0 & Delta==0 
summarize Farmers if Year == 1999 & Farmers >0 &Processors <=0 & Delta==0 
summarize Farmers if Year == 1999 & Farmers <=0 &Processors >0 & Delta==0 
summarize Farmers if Year == 1999 & Farmers <=0 &Processors <=0 & Delta==0 


///Appendix A2A///

pwcorr Vote Farmers narrow_Processors  Grocery  farmers_processors if Year ==1996 & Delta ==0, sig

///Appendix A2B
pwcorr Vote Farmers narrow_Processors Grocery   farmers_processors if Year ==1999  & Delta ==0, sig



///Appendix A4A ///


summarize Farmers Processors if Year==1996 & Delta==0 & Vote ==1 
summarize Farmers Processors if Year==1999 & Delta==0 & Vote ==0 

summarize Farmers Processors if Year==1996 & Delta==0 & Vote ==0
summarize Farmers Processors if Year==1999 & Delta==0 & Vote ==1 

summarize Farmers Processors if Year==1996 & Delta==1 & Vote ==1 
summarize Farmers Processors   if Year==1999 & Delta==1 & Vote ==1 


summarize Farmers Processors if Year==1996 & Delta==1 & Vote ==0 
summarize Farmers Processors   if Year==1999 & Delta==1 & Vote ==0 


///Appendix A5A/// 


summarize TopFarmer if Year == 1996 & TopFarmer >0 &top_opposition>0 & Delta==0 
summarize TopFarmer if Year == 1996 & TopFarmer >0 &top_opposition <=0 & Delta==0 
summarize TopFarmer if Year == 1996 & TopFarmer <=0 &top_opposition >0 & Delta==0 
summarize TopFarmer if Year == 1996 & TopFarmer <=0 &top_opposition <=0 & Delta==0 

//Appendix A5B//
summarize TopFarmer if Year == 1999 & TopFarmer >0 &top_opposition >0 & Delta==0 
summarize TopFarmer if Year == 1999 & TopFarmer >0 &top_opposition <=0 & Delta==0 
summarize TopFarmer if Year == 1999 & TopFarmer <=0 &top_opposition >0 & Delta==0 
summarize TopFarmer if Year == 1999 & TopFarmer <=0 &top_opposition<=0 & Delta==0 


//Appendinx A6///
sort appendix6


clogit Vote TopFarmer TopGrocer ACU_Adjusted term  log_milk ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using TableA6.doc, replace label eform pvalue 
randcmd ((TopFarmer TopGrocer) clogit Vote TopFarmer TopGrocer ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(TopFarmer TopGrocer)
clogit Vote TopFarmer  TopProcessor ACU_Adjusted term  log_milk ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using TableA6.doc, append label eform pvalue 
randcmd ((TopFarmer  TopProcessor) clogit Vote TopFarmer  TopProcessor ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(TopFarmer  TopProcessor)
clogit Vote TopFarmer TopGrocer TopProcessor ACU_Adjusted term  log_milk ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using TableA6.doc, append label eform pvalue 
randcmd ((TopFarmer TopGrocer TopProcessor) clogit Vote TopFarmer TopGrocer TopProcessor ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(TopFarmer TopGrocer TopProcessor)
clogit Vote TopFarmer  top_opposition ACU_Adjusted term  log_milk ,or   group(FEC_Code) cluster(FEC_Code)
outreg2 using TableA6.doc, append label eform pvalue 
randcmd ((TopFarmer  top_opposition) clogit Vote TopFarmer  top_opposition ACU_Adjusted term  log_milk , or group(FEC_Code)  cluster(FEC_Code)),treatvars(TopFarmer  top_opposition)









